package com.zlx.ssm.controller;

import com.zlx.ssm.service.impl.TableDateImpl;
import com.zlx.ssm.vo.AddUserInfo;
import com.zlx.ssm.vo.DateInfo;
import com.zlx.ssm.vo.ResultDateVo;
import com.zlx.ssm.vo.SelectVO;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

@Controller
@Slf4j
public class AdminController {
    
    @Autowired
    private TableDateImpl tableDate;

    @RequestMapping("/user/admin")
    public String adminList(){


        return "table";
    }

    //封装一个Json对象到表格
    @RequestMapping(value = "/user/date")
    @ResponseBody
    public ResultDateVo adminDate(SelectVO selectVO){

        log.info("查询数据 ：" +selectVO);
        ResultDateVo resultDateVo = tableDate.adnimDate(selectVO);


        //调用json对象进行修改

        return resultDateVo;
    }
}
